package jwdt.xadmin.work.bean;

import java.util.List;

import jwdt.common.util.CacheUtil;

import com.ezerg.db.Jdb;
import com.ezerg.db.annotation.Column;
import com.ezerg.db.annotation.Table;
import com.ezerg.fastjson.annotation.JSONField;

@Table(name="t_project", keys={"projectid"}, comment="项目管理")
public class TProject implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	@Column(value="projectid", comment="ID")
	private Integer projectid;
	
	@Column(value="fid", comment="上级项目")
	private Integer fid;
	
	@Column(value="name", comment="项目名称")
	private String name;
	
	@Column(value="starttime", comment="开始时间")
	private String starttime;
	
	@Column(value="stoptime", comment="结束时间")
	private String stoptime;
	
	@Column(value="content", comment="介绍")
	private String content;
	
	@Column(value="zt", comment="状态")
	private Integer zt;

	public Integer getProjectid() {
		return projectid;
	}

	public void setProjectid(Integer projectid) {
		this.projectid = projectid;
	}

	public Integer getFid() {
		return fid;
	}

	public void setFid(Integer fid) {
		this.fid = fid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Integer getZt() {
		return zt;
	}

	public void setZt(Integer zt) {
		this.zt = zt;
	}

	public String getStarttime() {
		return starttime;
	}

	public void setStarttime(String starttime) {
		if("".equals(starttime)) {
			starttime = null;
		}
		this.starttime = starttime;
	}

	public String getStoptime() {
		return stoptime;
	}

	public void setStoptime(String stoptime) {
		if("".equals(stoptime)) {
			stoptime = null;
		}
		this.stoptime = stoptime;
	}
	
	@JSONField(serialize=false)
	@SuppressWarnings("rawtypes")
	public List getChildren() {
		return Jdb.get().query(TProject.class, "fid=? ORDER BY projectid", new Object[]{this.projectid}, CacheUtil.C0);
	}
}
